aux_source_directory(. SOURCESCODE)
include(CMakePackageConfigHelpers)
include(FindPkgConfig)
pkg_check_modules(DBus REQUIRED
                dbus-1)
include_directories(${DBus_INCLUDE_DIRS})
add_library(kysdk-log SHARED ${SOURCESCODE})
set_target_properties(kysdk-log PROPERTIES VERSION 2.0.0 SOVERSION 1)
add_executable(kylog-testlog test/test-log.c)
add_executable(kylog-testsetdir test/test-setdir.c)
add_executable(kylog-testpressure test/test-pressure.c)
add_executable(kylog-testautowrap test/test-autowrap.c)
find_library(SYSTEMD_LIB systemd)
find_library(DBUS_LIB dbus-1)
target_link_libraries(kysdk-log kysdk-config pthread ${SYSTEMD_LIB} ${DBUS_LIB})
target_link_libraries(kylog-testlog kysdk-log)
target_link_libraries(kylog-testsetdir kysdk-log)
target_link_libraries(kylog-testautowrap kysdk-log)
target_link_libraries(kylog-testpressure kysdk-log)

install(TARGETS kysdk-log
	DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(FILES libkylog.h
        DESTINATION include/kysdk/kysdk-base)

install(FILES kylog-rotate-default
        DESTINATION /etc/kysdk/kysdk-base)
